package cn.iocoder.yudao.module.acm.dal.mysql.cleaningplan;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.acm.controller.admin.cleaningplan.vo.CleaningPlanPageReqVO;
import cn.iocoder.yudao.module.acm.dal.dataobject.cleaningplan.CleaningPlanDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 机供品餐具清洗计划 Mapper
 *
 * @author yisl
 */
@Mapper
public interface CleaningPlanMapper extends BaseMapperX<CleaningPlanDO> {

    default PageResult<CleaningPlanDO> selectPage(CleaningPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CleaningPlanDO>()
                .likeIfPresent(CleaningPlanDO::getCplanCode, reqVO.getCplanCode())
                .likeIfPresent(CleaningPlanDO::getFlightNo, reqVO.getFlightNo())
                .eqIfPresent(CleaningPlanDO::getCleaningStatus, reqVO.getCleaningStatus())
                .geIfPresent(CleaningPlanDO::getStartDate, reqVO.getStartDate())
                .leIfPresent(CleaningPlanDO::getEndDate, reqVO.getEndDate())
                .orderByDesc(CleaningPlanDO::getId));
    }

}